'use strict';

function grouping_count(collection) {
let obj={};
for(let item of collection){
  if(!obj[item]){
    obj[item]={};
    obj[item]=1;
  }else{
    obj[item]++;
  }
}

console.log(obj);
return obj;

}
grouping_count( [1,1,1,1,2,3,1,3,4,2,3,1,3,4,2]);
module.exports = grouping_count;
